package host;

import gui.GUIHandler;
import config.LauncherHelper;
import room.Room;

public class HostingHandler {

	public static void joinGame(Room room){
		if(room.isLocked){
			if(GUIHandler.launchEnterRoomPWDialog(room)){
				LauncherHelper.generateConfig(room);
				LauncherHelper.runGame("-j");
			} else GUIHandler.launchWrongPWDialog();
		}else{
			LauncherHelper.generateConfig(room);
			LauncherHelper.runGame("-j");
		}

	}

}
